// app.js
App({
	data:{
		placelist:{}
	},
	onLaunch(){
		var that=this
		wx.cloud.init({
			env:'cloud1-0gx97t1pd46ba14f'
		})
		const db=wx.cloud.database()
		db.collection('placeList').get().then(res=>{
			console.log(res)
			var placelist={}
			var pricelist={}
			var imagelist={}
			var itemlist={}
			var	reslist=res.data
			reslist.forEach(element => {
				placelist[element._id]=element.name
				itemlist[element._id]=element
				imagelist[element._id]=element.images[0]
				pricelist[element._id]=element.aprice
				wx.setStorageSync('placelist', placelist)
				wx.setStorageSync('itemlist', itemlist)
				wx.setStorageSync('pricelist', pricelist)
				wx.setStorageSync('imagelist', imagelist)
			});
		})
	}
})
